package com.yzw.hello.model.pojos.business.video;

import java.sql.Time;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.yzw.hello.model.pojos.business.tag.Tag;

@Entity
@Table(name = "video")
public class Video {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	@Column(nullable = false, updatable = true, length = 50)
	@NotNull
	@Length(max = 50, message = "名称不能超过{max}")
	private String name;

	@Column(nullable = false, updatable = true, length = 50)
	@NotNull
	@Length(max = 50, message = "名称不能超过{max}")
	private String descript;

	@Column(nullable = false, updatable = true, length = 50)
	@NotNull
	@Length(max = 50, message = "名称不能超过{max}")
	private String remark;

	@Column(nullable = false, updatable = true, length = 500)
	@NotNull
	private String url;

	@Column(nullable = false, updatable = true)
	@NotNull
	private Time time;

	@Column(nullable = false, updatable = true, length = 50)
	@NotNull
	@Length(max = 50, message = "名称不能超过{max}")
	private String size;

	@Column(nullable = false, updatable = true)
	@NotNull
	private boolean sign;

	@Column(nullable = false, updatable = true, length = 50)
	@NotNull
	@Length(max = 50, message = "名称不能超过{max}")
	private Integer viewcount;

	@Column(updatable = true, length = 500)
	@Length(max = 500, message = "名称不能超过{max}")
	private String screen;

	@OneToMany(mappedBy = "video", cascade = CascadeType.ALL)
	private List<Tag> tags;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescript() {
		return descript;
	}

	public void setDescript(String descript) {
		this.descript = descript;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Time getTime() {
		return time;
	}

	public void setTime(Time time) {
		this.time = time;
	}

	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public boolean isSign() {
		return sign;
	}

	public void setSign(boolean sign) {
		this.sign = sign;
	}

	public Integer getViewcount() {
		return viewcount;
	}

	public String getScreen() {
		return screen;
	}

	public void setScreen(String screen) {
		this.screen = screen;
	}

	public void setViewcount(Integer viewcount) {
		this.viewcount = viewcount;
	}

	public List<Tag> getTags() {
		return tags;
	}

	public void setTags(List<Tag> tags) {
		this.tags = tags;
	}

}
